package com.itheima.thread15;

import java.util.concurrent.ArrayBlockingQueue;

public class demo01 {
    public static void main(String[] args) throws InterruptedException {
        //阻塞队列的基本用法

        //创建阻塞队列对象,容量为1
        ArrayBlockingQueue<String> str = new ArrayBlockingQueue<String>(1);

        //存储元素
        str.put("汉堡包");

        //取元素
        System.out.println(str.take());
        System.out.println(str.take());

        System.out.println("你好帅");
    }
}


